//Casa@131007b
//caculator
//usage:
//cac 12+8*(45+33/3)

#include <iostream>
#include <stack>
#include <string>
#include <sstream>
using namespace std;

char help[]="caculator cac 1.0\n\
Casa@131007b\n\
Email:lag.zhang@gmail.com\n\
usage:\n\
cac 12+8*(45+33/3)";

int prior(char op)
{
if(op=='+'||op=='-')
	return 1;
if(op=='*'||op=='/')
	return 2;
return 0;
}
string middletolast(string middle)
{
stack<char> op;
string ans;
for(int i=0;i<middle.size();i++)
{

	char c=middle[i];
	if(c>='0'&&c<='9')
	{
	while((c>='0'&&c<='9')||c=='.'){
	ans.append(1,c);
	//ans+=' ';
	i++;
	if(i<middle.size())
	c=middle[i];}
	ans+=' ';
	i--;
	}
else
{
if(c=='(')
op.push('(');
else
{
if(c==')')
{
while(op.top()!='(')
{
ans.append(1,op.top());
ans+=' ';
op.pop();
}
op.pop();
}
else
{
if(op.empty())
{
op.push(c);
}
else
{
if(prior(c)>prior(op.top()))
op.push(c);
else
{
while(!op.empty()&&prior(c)<=prior(op.top()))
{

ans.append(1,op.top());
ans+=' ';
op.pop();
}
op.push(c);
}
}
}
}
}
}
while(!op.empty())
{

ans.append(1,op.top());
ans+=' ';
op.pop();
}
return ans;
}
int main(int argc,char** argv)
{
string mdata,res;
if(argc==1)
{
cout<<help<<endl;
return 0;
}
mdata+="(";
mdata+=argv[1];
mdata+=")";
res=middletolast(mdata);
//Caculate the suffix expression
//Casa@131007b
//cout<<"expression done"<<endl;
//clog<<res<<endl;
istringstream in(res);
stack<double> st;
string ss;
while(in>>ss)
{
//cout<<"<"<<ss<<">"<<endl;
//if(ss.empty())break;
	if(ss=="+"||ss=="-"||ss=="*"||ss=="/")
		{
//cout<<ss;
			double b=st.top();
			st.pop();
			double a=st.top();
			st.pop();
			if(ss=="+")
			st.push(a+b);
			else if(ss=="-")
			st.push(a-b);
			else if(ss=="*")
			st.push(a*b);
			else if(ss=="/")
			st.push(a/b);
			else 
			cerr<<"error:operator failed"<<endl;
		}
	else
	{
	istringstream din(ss);
	double t;
	din>>t;
	//cout<<"["<<t<<"]";
	st.push(t);
	}
}
cout<<st.top()<<endl;
return 0;
}